package April._19.work2;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Arrays;

public class Main {
    public static void main(String[] args)throws IOException {
        FileInputStream in = new FileInputStream("fileTest\\a.txt");
        byte[] bytes = new byte[1024];
        int read = in.read(bytes);
        Arrays.sort(bytes,0,read-1);
        in.close();

        FileOutputStream out = new FileOutputStream("fileTest\\a.txt",true);
        out.write(System.lineSeparator().getBytes());
        out.write(bytes,0,read);
    }
}
